<!DOCTYPE html>
<html>

<!-- Mirrored from /theme/hplus/table_foo_table.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:03 GMT -->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>乡土味士-自媒体后台管理中心 - FooTable</title>
<meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
<meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">
<link rel="shortcut icon" href="favicon.ico">
<link href="__PUBLIC__/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
<link href="__PUBLIC__/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
<link href="__PUBLIC__/css/plugins/footable/footable.core.css" rel="stylesheet">
<link href="__PUBLIC__/css/animate.min.css" rel="stylesheet">
<link href="__PUBLIC__/css/plugins/summernote/summernote.css" rel="stylesheet">
<link href="__PUBLIC__/css/plugins/summernote/summernote-bs3.css" rel="stylesheet">
<link href="__PUBLIC__/css/style.min862f.css?v=4.1.0" rel="stylesheet">
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
  <div class="row">
    <div class="col-sm-12">
      <div class="ibox float-e-margins">
        <div class="ibox-title">
          <button type="button" class="btn btn-w-m btn-success" onClick="window.location.href='__MODULE__/Village/'">返回</button>
          <div class="ibox-tools"> </div>
        </div>
        <div class="ibox-content">
          <div class="row form-body form-horizontal m-t">
            <div class="col-md-12">
              <div class="form-group">
                <label class="col-sm-3 control-label">村庄名称：</label>
                <div class="col-sm-9">
                  <input type="text" name="title" style="width:30%;" class="form-control" placeholder="请输入文本">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-3 control-label">详细地址：</label>
                <div class="col-sm-9">
                  <select class="form-control select-1" name="area_lev_1" style="width: 15%;float: left;">
                  	<option value="0">请选择</option>
                  <volist name="areali" id="vo">
                  	<option value="{$vo.id}">{$vo.name}		编号:{$vo.area_id}（{$vo.id}）</option>
                  </volist>
                  </select>
                  <select class="form-control select-2" name="area_lev_2" style="width: 15%;float: left;margin-left: 8px;">
                  </select>
                  <select class="form-control select-3" name="area_lev_3" style="width: 15%;float: left;margin-left: 8px;">
                  </select>
                  <select class="form-control select-4" name="area_lev_4" style="width: 15%;float: left;margin-left: 8px;">
                  </select>
                  <select class="form-control select-5" name="area_lev_5" style="width: 15%;margin-left: 8px;">
                  </select>
                </div>
              </div>
              
              <div class="form-group">
                <label class="col-sm-3 control-label">介绍：</label>
                <div class="summernote">
                  <p>从这里开始介绍村庄的人文、历史、旅游……</p>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-3 control-label">视频地址：</label>
                <div class="col-sm-9">
                  <input type="text" name="video_url" style="width:30%;" class="form-control" placeholder="请输入文本">
                  <span class="help-block m-b-none">(以视频文件结尾的网址)</span> </div>
              </div>
              <!--<div class="form-group">
                <label class="col-sm-3 control-label">加入时间：</label>
                <div class="col-sm-9">
                  <p class="form-control-static">这里是纯文字信息</p>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-3 control-label">更新时间：</label>
                <div class="col-sm-9">
                  <p class="form-control-static">这里是纯文字信息</p>
                </div>
              </div>-->
              <div class="form-group">
                <div class="col-sm-12 col-sm-offset-3">
                  <button class="btn btn-primary" onClick="save_v()">添加</button>
                  <a style="margin-left:8px;" class="btn btn-primary" onClick="clswidth()">清除图片宽</a>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<script src="__PUBLIC__/js/jquery.min.js?v=2.1.4"></script> 
<script src="__PUBLIC__/js/bootstrap.min.js?v=3.3.6"></script> 
<script src="__PUBLIC__/js/plugins/footable/footable.all.min.js"></script> 
<script src="__PUBLIC__/js/content.min.js?v=1.0.0"></script> 
<script src="__PUBLIC__/js/plugins/summernote/summernote.min.js"></script> 
<script src="__PUBLIC__/js/plugins/summernote/summernote-zh-CN.js"></script> 
<script>
        $(document).ready(function(){$(".footable").footable();$(".footable2").footable()});
    </script> 
<script>
        $(document).ready(function(){
			$(".summernote").summernote({lang:"zh-CN"});
			$(".note-editor").css("width","70%");
			$(".note-editor").css("float","left");
			$(".note-editable").css("height","308px");
		});
		var edit=function(){$("#eg").addClass("no-padding");$(".click2edit").summernote({lang:"zh-CN",focus:true})};var save=function(){$("#eg").removeClass("no-padding");var aHTML=$(".click2edit").code();$(".click2edit").destroy()};
    </script>
    
<script type="text/javascript">
$(document).ready(function(){
	//一级
  $(".select-1").change(function(){
	//获取下一级所有地址
    $.ajax({
    type : "POST",
    dataType : "json",
    url: "__MODULE__/Area/getnext/rid/"+$(".select-1").val(),
    async:false,
    success: function(data){
		//展示下一级地区
		var instr="<option value='0'>请选择</option>";
		for(var i=0;i<data.length;i++){
			instr+="<option value='"+data[i].id+"'>"+data[i].name+"		编号:"+data[i].area_id+"（"+data[i].id+"）"+"</option>";
			}//end for
		$(".select-2 option").remove();//移除所有option
		$(".select-3 option").remove();//移除所有option
		$(".select-4 option").remove();//移除所有option
		$(".select-5 option").remove();//移除所有option
		$(".select-2").append(instr);//添加新的option
    }
	});//end ajax

  });//end change
  //二级
  $(".select-2").change(function(){
	//获取下一级所有地址
    $.ajax({
    type : "POST",
    dataType : "json",
    url: "__MODULE__/Area/getnext/rid/"+$(".select-2").val(),
    async:false,
    success: function(data){
		//展示下一级地区
		var instr="<option value='0'>请选择</option>";
		for(var i=0;i<data.length;i++){
			instr+="<option value='"+data[i].id+"'>"+data[i].name+"		编号:"+data[i].area_id+"（"+data[i].id+"）"+"</option>";
			}//end for
		$(".select-3 option").remove();//移除所有option
		$(".select-4 option").remove();//移除所有option
		$(".select-5 option").remove();//移除所有option
		$(".select-3").append(instr);//添加新的option
    }
	});//end ajax

  });//end change
  //三级
  $(".select-3").change(function(){
	//获取下一级所有地址
    $.ajax({
    type : "POST",
    dataType : "json",
    url: "__MODULE__/Area/getnext/rid/"+$(".select-3").val(),
    async:false,
    success: function(data){
		//展示下一级地区
		var instr="<option value='0'>请选择</option>";
		for(var i=0;i<data.length;i++){
			instr+="<option value='"+data[i].id+"'>"+data[i].name+"		编号:"+data[i].area_id+"（"+data[i].id+"）"+"</option>";
			}//end for
		$(".select-4 option").remove();//移除所有option
		$(".select-5 option").remove();//移除所有option
		$(".select-4").append(instr);//添加新的option
    }
	});//end ajax

  });//end change
  //四级
  $(".select-4").change(function(){
	//获取下一级所有地址
    $.ajax({
    type : "POST",
    dataType : "json",
    url: "__MODULE__/Area/getnext/rid/"+$(".select-4").val(),
    async:false,
    success: function(data){
		//展示下一级地区
		var instr="<option value='0'>请选择</option>";
		for(var i=0;i<data.length;i++){
			instr+="<option value='"+data[i].id+"'>"+data[i].name+"		编号:"+data[i].area_id+"（"+data[i].id+"）"+"</option>";
			}//end for
		$(".select-5 option").remove();//移除所有option
		$(".select-5").append(instr);//添加新的option
    }
	});//end ajax

  });//end change
  //五级
  $(".select-5").change(function(){
	//获取下一级所有地址
    $.ajax({
    type : "POST",
    dataType : "json",
    url: "__MODULE__/Area/getnext/rid/"+$(".select-5").val(),
    async:false,
    success: function(data){
		//展示下一级地区
		var instr="<option value='0'>请选择</option>";
		for(var i=0;i<data.length;i++){
			instr+="<option value='"+data[i].id+"'>"+data[i].name+"		编号:"+data[i].area_id+"（"+data[i].id+"）"+"</option>";
			}//end for
		//$(".select-6 option").remove();//移除所有option
		//$(".select-6").append(instr);//添加新的option
    }
	});//end ajax

  });//end change
  
});

function save_v(){
	//增加，更新地址
    $.ajax({
    type : "POST",
    dataType : "json",
	data:{title:$("input[name='title']").val(),area_lev_1:$("select[name='area_lev_1']").val(),area_lev_2:$("select[name='area_lev_2']").val(),area_lev_3:$("select[name='area_lev_3']").val(),area_lev_4:$("select[name='area_lev_4']").val(),area_lev_5:$("select[name='area_lev_5']").val(),content:$(".note-editable").html(),video_url:$("input[name='video_url']").val()},
    url: "__MODULE__/Village/ins/",
    async:false,
    success: function(data){
		if(data=='ok'){
			alert("添加成功");
			window.location.href='__MODULE__/Village/';
			}else{
				alert("添加失败，请重新点击【添加】按钮！");
			}
    }
	});//end ajax
}//end fun
</script>
</body>

<!-- Mirrored from /theme/hplus/table_foo_table.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:03 GMT -->
</html>
